#!/usr/bin/python
# -*- coding: UTF-8 -*-
from http.server import HTTPServer, BaseHTTPRequestHandler
from socketserver import ThreadingMixIn

import os

from mods.server import Server
import data.config as CONFIG

# 多线程类
class ThreadedHTTPServer(ThreadingMixIn, HTTPServer):
       pass

# 入口类
class main:
    def start_SERVER(self):
        PORT = 8000

        httpd = ThreadedHTTPServer(('localhost', CONFIG.server['port']),Server)
        print(f"Server started at http://{CONFIG.server['name']}:{CONFIG.server['port']}")
        
        httpd.serve_forever()
    
t = main()

t.start_SERVER()
#print(CONFIG.server['port'])
